<!--  -->
<template>
  <div>
      
 <van-nav-bar   title="我的评价" left-text="返回" left-arrow />
  <div class="pinherd">
      <van-image
  round
  width="80px"
  height="80px"
  src="https://img01.yzcdn.cn/vant/cat.jpeg"
/>
    <router-link   class="pinjia" to="Allcomments">
        <div>
        <span>全部评价</span>
        <span class="chu">{{eva.length}}</span>
        </div>
    </router-link>
    <router-link class="pinjia" to="Tobeevaluated" @click="dianji">
    <div>
        <span>待评价</span>
        <span class="chu">{{vae.length}}</span>
    </div>
    </router-link>
  </div>
  
  <router-view></router-view>
  </div>
</template>

<script>
export default {
name : 'evaluate',
data(){
    return{
        active:false,
        // 全部评论条数
        eva:[],
        // 未评价商品条数
        vae:[]
    }
},
methods: {
  dianji(){
      this.active=true
  }
},
created(){
    let sess = JSON.parse(sessionStorage.getItem("user"))

  //全部评论条数
  this.$axios.post('/api/marketComment/showByUser?userId='+sess.userId).then((res)=>{
    this.eva=res.data.data
    console.log(res.data.data)
  }).catch((err)=>{console.log("失败")})

// 待评论条数
   this.$axios.post('/api/marketOrder/myOrderList?userId='+sess.userId+'&orderStatus=4').then((res)=>{
    this.vae=res.data.data
    console.log(res.data.data)
  }).catch((err)=>{console.log("失败")})
}
  }
</script>

<style  scoped>
.pinjia>div{
   text-align: center;
    display: flex;
    flex-direction:column ; 
    justify-content:center;
}
.pinherd{
    border-bottom: 1px solid #dad5d5;
    display: flex;
    justify-content:space-around;
    align-items:center;
    
}
a{
     text-decoration: none;
     color: black;
}

.router-link-active {
    text-decoration: none ;
    color: #FF6633;
}
.van-image{
    margin-bottom: 10px;
}
.chu{
    font-size: 20px;
    font-weight:700;
}

</style>
